{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ac29890a",
   "metadata": {},
   "source": [
    "# 1.位置信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b158256d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.678280,23.628439'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import requests\n",
    "geo_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "payload = {\n",
    "    \"key\":\"b0121f143057c2f0c3607e48fe21bac9\",\n",
    "    \"address\":\"广东省广州市从化区广州南方学院\"\n",
    "}\n",
    "r = requests.get(url=geo_url, params=payload)\n",
    "广州南方学院_location = r.json()['geocodes'][0]['location']\n",
    "广州南方学院_location"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "faad9475",
   "metadata": {},
   "source": [
    "# 2.搜索POI\n",
    "* 搜索方式\n",
    "> 1. keywords(关键词)\n",
    "> 2. types(分类搜索-例如高德的分类)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e4985ef5",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2.请求方法：GET\n",
    "# 3.请求的周边搜索url地址：https://restapi.amap.com/v5/place/around?parameters\n",
    "around_url = \"https://restapi.amap.com/v5/place/around?parameters\"\n",
    "\n",
    "# 4.请求的参数（payload）\n",
    "payload = {\n",
    "    \"key\":\"091c69bb3b356e0f0eb237e4e7a62a45\",\n",
    "    \"keywords\":\"中餐厅\",\n",
    "    \"location\":\"113.678280,23.628439\",\n",
    "    \"page\":2\n",
    "}\n",
    "# 5.发起请求\n",
    "r = requests.get(url=keyword_url,params=payload)\n",
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "eea8aa93",
   "metadata": {},
   "outputs": [],
   "source": [
    "# types 编码表\n",
    "# 2.请求方法：GET\n",
    "# 3.请求的周边搜索url地址：https://restapi.amap.com/v5/place/around?parameters\n",
    "around_url = \"https://restapi.amap.com/v5/place/around?parameters\"\n",
    "\n",
    "# 4.请求的参数（payload）\n",
    "payload = {\n",
    "    \"key\":\"091c69bb3b356e0f0eb237e4e7a62a45\",\n",
    "    \"types\":\"050100\",\n",
    "    \"location\":\"113.678280,23.628439\",\n",
    "    \"page\":2\n",
    "}\n",
    "# 5.发起请求\n",
    "r = requests.get(url=keyword_url,params=payload)\n",
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2dd04040",
   "metadata": {},
   "source": [
    "* json 字体颜色 \n",
    "* wxml 图片布局\n",
    "* wxss 页面颜色\n",
    "## 微信小程序开发文档中的API---微信生态的API接口"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a473d4ab",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "11197bd4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
